import { createI18n } from 'vue-i18n';
import { LocaleStorageImpl } from '@2/app/core/storage/impl/locale.storage.impl';

export let i18n: ReturnType<typeof createI18n>;
/**
 * 本地国际化设置
 */
export default class LocalesI18n {
  /**
   * 设置国际化加载消息内容
   */
  public static async setupI18nMessage(): Promise<object> {
    const locale = new LocaleStorageImpl().getLocale();
    const defaultLocal = await import(`./lang/${locale}.ts`);
    return defaultLocal.default?.message ?? {};
  }
}
